package com.demo.service.impl;

import com.demo.dao.CustomerDao;
import com.demo.domain.Customer;
import com.demo.service.CustomerService;

import java.util.List;

public class CustomerServiceImpl implements CustomerService {
    private CustomerDao customerDao;

    public void setCustomerDao(CustomerDao customerDao) {
        this.customerDao = customerDao;
    }

    //保存
    @Override
    public void saveCustomer(Customer customer) {

        customerDao.save(customer);
    }

    //查询所有客户
    @Override
    public List<Customer> find() {
        return customerDao.find();
    }

    //通过id查询
    @Override
    public Customer findOne(int cust_id) {
        return customerDao.findOne(cust_id);
    }

    //删除
    @Override
    public void delete(Customer c) {

        customerDao.delete(c);
    }

    //修改
    @Override
    public void update(Customer customer) {
        customerDao.update(customer);
    }

    //条件查询
    @Override
    public List<Customer> findCondition(Customer customer) {
        List<Customer> list = customerDao.findCondition(customer);
        return list;
    }

    @Override
    public List<Customer> findMoreCondition(Customer customer) {
        return customerDao.findMoreCondition(customer);
    }


}
